<%@ page language="java" contentType="text/html; charse=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<title>轻松玩--登录</title>
<jsp:include page="../public/header.jsp"/>
<link href="/public/css/login.css" rel="stylesheet" type="text/css" />
<style>
	body{
		background-image:url(/public/image/login-bg.jpg);
		 
            background-repeat: no-repeat;
            background-position: center;
            background-size: cover;
    }
</style>
</head>
<body>
<jsp:include page="../public/nav.jsp"/>

	<div class="login-context">
    	<div class="title">登录</div>
        <div class="username"><input id="name" class="input-text" placeholder="用户名"></div>
        <div class="pwd"><input id="pwd" class="input-text" type="password" placeholder="密码"></div>
        <div class="remeber"><input type="checkbox"> 记住我</div>
        <div class="submit"><input id="submit" class="btn btn-warning" type="submit" value="登录"></div>
        <div class="reg">还没有账号,<a href="#" class="danger">注册!!!</a>,欢迎加入我们</div>
    </div>
<jsp:include page="../public/footer.jsp"/>
</body>
<jsp:include page="../public/footer2.jsp"/>
<script type="text/javascript">
	$(function(){
		$("#submit").click(function(){
			$.ajax({url:"login_chk.html",data:{name:$("#name").val(),pwd:$("#pwd").val()},type:"post",success:function(data){
				if(data == 1){
					alert("登录成功");
					window.location.href="/index.html";
				}else{
					alert("登录失败！用户名或者密码错误！");
				}
			}});	
		})
	})
</script>
</html>
